<!-- 头部 -->
<include file="Public:header" />

<!-- 资料认证  侧边/头部 -->
<include file="Public:zlrz_header" />


            <div style="height: 976px;" class="nav-a-settings" id="navconfig">
                <ul style="top: 0px;">
                    <li data-nav="showI1">
                        <a href="{:U('laoshi/zlrz',array('newcity'=>$city))}">
                            <span class="sp2">
                                &nbsp;
                            </span>
                            资料认证
                        </a>
                    </li>
                    <li data-nav="showI2">
                        <a href="{:U('laoshi/zlrz_head',array('newcity'=>$city))}">
                            <span class="sp3">
                                &nbsp;
                            </span>
                            头像
                        </a>
                    </li>
                    <li data-nav="showI3">
                        <a href="{:U('laoshi/introduce',array('newcity'=>$city))}">
                            <span class="sp4">
                                &nbsp;
                            </span>
                            自我介绍
                        </a>
                    </li>
                    <li data-nav="showI4">
                        <a href="{:U('laoshi/teaching',array('newcity'=>$city))}">
                            <span class="sp5">
                                &nbsp;
                            </span>
                            授课信息
                        </a>
                    </li>
                    <li data-nav="showI0">
                        <a href="{:U('laoshi/zhanghao',array('newcity'=>$city))}">
                            <span class="sp1">
                                &nbsp;
                            </span>
                            账号及密码
                        </a>
                    </li>
                    <li data-nav="showI0">
                        <a href="{:U('laoshi/bank',array('newcity'=>$city))}" class="active">
                            <span class="sp6">
                                &nbsp;
                            </span>
                            绑定银行卡
                        </a>
                    </li>
                </ul>
            </div>
        <div class="content-a-settings" id="CoF0" style="overflow: hidden;height: 600px;">
            <div class="heaD">
                <ul class="nav-lia cLr" id="nav-setup-area0">
                    <li><a href="javascript:void(0);" data-tab="tab-password" class="active">添加/修改银行卡</a></li>
                </ul>
            </div>
            <div class="o0o desc-F60" style="margin-left: 60px;">
                温馨提示：
                <br>
                请认真填写真实的,有效的银行卡信息。
            </div>
            <form class="layui-form" method="post" style="margin-left: 60px;">
                <div class="bind_warp">
                        <dl class="binding_cards title-o0o">
                            <dd>
                                <label for=""><span class="bind_txt_dot"></span>开户人姓名：</label>
                                <input name="bank_name" value="{$bank.bank_name}" type="text" required lay-verify="required" style="width: 330px;height: 35px;border: 1px solid #eee;margin-bottom: 10px;">
                            </dd>
                            <dd>
                                <label for=""><span class="bind_txt_dot"></span>开户行地址：</label>
                                <input name="bank_addr" value="{$bank.bank_addr}" type="text" required lay-verify="required" style="width: 330px;height: 35px;border: 1px solid #eee;margin-bottom: 10px;">
                            </dd>
                            <dd>
                                <label for=""><span class="bind_txt_dot"></span>请选择银行：</label>
                                <div class="inp-si" id="uide" style="width: 330px;">
                                    <select name="bank" id="" required lay-verify="required">
                                        <option value="{$bank.bank}" selected>{$bank.bank}</option>
                                        <option value="中国工商银行">中国工商银行</option>
                                        <option value="中国农业银行">中国农业银行</option>
                                        <option value="中国建设银行">中国建设银行</option>
                                        <option value="中国银行">中国银行</option>
                                        <option value="交通银行">交通银行</option>
                                        <option value="招商银行">招商银行</option>
                                        <option value="中国民生银行">中国民生银行</option>
                                        <option value="浦发银行">浦发银行</option>
                                        <option value="中信银行">中信银行</option>
                                        <option value="兴业银行">兴业银行</option>
                                        <option value="光大银行">光大银行</option>
                                        <option value="平安银行">平安银行</option>
                                        <option value="广发银行">广发银行</option>
                                    </select>
                                </div>
                            <span class="only_cxcard" style="color:#777;">仅限储蓄卡</span>
                            </dd>
                            <dd style="padding-top: 10px;">
                                <label for=""><span class="bind_txt_dot"></span>填银行卡号：</label>
                                <input name="bank_num" value="{$bank.bank_num}" type="text" required lay-verify="required" style="width: 330px;height: 35px;border: 1px solid #eee;margin-bottom: 10px;">
                                <div class="bind_tips"><span style="color:red;">您绑定的银行卡必须是您本人的银行卡</span></div>
                            </dd>
                        </dl>
                        <div class="sub_binding">
                            <input type="hidden" name="uid" value="{$_SESSION['id']}">
                            <input type="hidden" name="is_who" value="{$_SESSION['is_who']}">
                            <button class="layui-btn layui-btn-warm" lay-filter="*" lay-submit style="background-color: #30c76c;">提交绑定</button>
                        </div>
                </div>
            </form>
        </div>
        <script>
            layui.use(['element','laypage','layer','form'], function(){
                $ = layui.jquery;//jquery
              lement = layui.element();//面包导航
              laypage = layui.laypage;//分页
              layer = layui.layer;//弹出层
              form = layui.form();//弹出层


            form.on('submit(*)', function(data){
                console.log(data);
                $.ajax({
                    url: "{:U('laoshi/bank_add')}",//请求地址
                    type: "post",//请求方式
                    dataType: "json",//返回数据类型
                    data: data.field,//发送的参数
                    })
                    .done(function(response) {
                          if(response.error==0){
                             layer.msg(response.info ,{icon:5});
                          }else{
                             layer.alert(response.info ,{icon:6},function(){
                                // location.href = response.url;
                                location.reload();
                             });
                             
                          }
                      })
                    .fail(function() {
                        alert("ajxs交互失败");
                    })  
                  return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
                });  

          })
        </script> 
</html>